<!DOCTYPE html>
<html lang="en">
<head>
<title>Brook Tardigrade: BrookMathExpression</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="PasDoc 0.16.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="tipuesearch/tipuesearch.css">

<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<div class="container"><div class="navigation">
<h2><a href="index.html">Brook Tardigrade</a></h2><ul><li><a href="AllUnits.html">Units</a></li><li><a href="ClassHierarchy.html">Class Hierarchy</a></li><li><a href="AllClasses.html">Classes, Interfaces, Objects and Records</a></li><li><a href="AllTypes.html">Types</a></li><li><a href="AllVariables.html">Variables</a></li><li><a href="AllConstants.html">Constants</a></li><li><a href="AllFunctions.html">Functions and Procedures</a></li><li><a href="AllIdentifiers.html">Identifiers</a></li><li><form class="search-form" action="tipue_results.html"><div class="search-input"><input type="text" name="q" id="tipue_search_input" pattern=".{3,}" title="At least 3 characters" required><div class="search-button"><input type="button" id="tipue_search_button" onclick="this.form.submit();"></div></div></form>
<div style="clear: both"></div>
</li></ul></div><div class="content">
<h1 class="unit">Unit BrookMathExpression</h1>
<div class="sections">
<div class="one_section"><a class="section" href="#PasDoc-Description">Description</a></div><div class="one_section"><a class="section" href="#PasDoc-Uses">Uses</a></div><div class="one_section"><a class="section" href="#PasDoc-Classes">Classes, Interfaces, Objects and Records</a></div><div class="one_section"><a class="section" href="#PasDoc-FuncsProcs">Functions and Procedures</a></div><div class="one_section"><a class="section" href="#PasDoc-Types">Types</a></div><div class="one_section"><a class="section" href="#PasDoc-Constants">Constants</a></div><div class="one_section">Variables</div></div>
<span id="PasDoc-Description"></span><h2 class="description">Description</h2>
<p>
Contains class to <a class="normal" href="BrookMathExpression.html#Evaluate">evaluate</a> mathematical expressions.</p>
<span id="PasDoc-Uses"></span><h2 class="uses">Uses</h2>
<ul class="useslist"><li>SysUtils</li><li>Math</li><li>Classes</li><li>Marshalling</li><li>libsagui</li><li><a href="BrookHandledClasses.html">BrookHandledClasses</a></li></ul><h2 class="overview">Overview</h2>
<span id="PasDoc-Classes"></span><h3 class="cio">Classes, Interfaces, Objects and Records</h3>
<table class="classestable wide_list">
<tr class="listheader">
<th class="itemname">Name</th>
<th class="itemdesc">Description</th>
</tr>
<tr class="list">
<td class="itemname">Packed Record&nbsp;<a class="bold" href="BrookMathExpression.TBrookMathExpressionError.html"><code>TBrookMathExpressionError</code></a></td>
<td class="itemdesc">Structured type which holds the mathematical expression errors.</td>
</tr>
<tr class="list2">
<td class="itemname">Packed Record&nbsp;<a class="bold" href="BrookMathExpression.TBrookMathExpressionExtension.html"><code>TBrookMathExpressionExtension</code></a></td>
<td class="itemdesc">Structured type which holds the properties of a math expression extension.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="BrookMathExpression.TBrookMathExpression.html"><code>TBrookMathExpression</code></a></td>
<td class="itemdesc">Mathematical <a class="normal" href="BrookMathExpression.TBrookMathExpression.html#Expression">expression</a> evaluator.</td>
</tr>
</table>
<span id="PasDoc-FuncsProcs"></span><h3 class="summary">Functions and Procedures</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code>function <strong><a href="BrookMathExpression.html#Evaluate">Evaluate</a></strong>(const AExpression: string): Double;</code></td>
</tr>
</table>
<span id="PasDoc-Types"></span><h3 class="summary">Types</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><strong><a href="BrookMathExpression.html#TBrookMathExpressionErrorKind">TBrookMathExpressionErrorKind</a></strong> = (...);</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><strong><a href="BrookMathExpression.html#TBrookMathExpressionErrorEvent">TBrookMathExpressionErrorEvent</a></strong> = procedure(ASender: TObject; AError: <a href="BrookMathExpression.TBrookMathExpressionError.html">TBrookMathExpressionError</a>) of object;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><strong><a href="BrookMathExpression.html#TBrookMathExpressionExtensionEvent">TBrookMathExpressionExtensionEvent</a></strong> = function(ASender: TObject; AExtension: <a href="BrookMathExpression.TBrookMathExpressionExtension.html">TBrookMathExpressionExtension</a>): Double of object;</code></td>
</tr>
</table>
<span id="PasDoc-Constants"></span><h3 class="summary">Constants</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><strong><a href="BrookMathExpression.html#SBrookInactiveMathExpression">SBrookInactiveMathExpression</a></strong> = 'Inactive math expression.';</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Functions and Procedures</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="Evaluate"></span><code>function <strong>Evaluate</strong>(const AExpression: string): Double;</code></td>
</tr>
<tr><td colspan="1">
<p>
Evaluates a mathematical expression.</p>
</td></tr>
</table>
<h3 class="detail">Types</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="TBrookMathExpressionErrorKind"></span><code><strong>TBrookMathExpressionErrorKind</strong> = (...);</code></td>
</tr>
<tr><td colspan="1">
<p>
Possible error types returned by the mathematical expression evaluator.</p>
<h6 class="description_section">Values</h6>
<ul>
<li>
<span id="ekNone">ekNone</span>: None error.</li>
<li>
<span id="ekUnknown">ekUnknown</span>: Error not related to evaluation.</li>
<li>
<span id="ekUnexpectedNumber">ekUnexpectedNumber</span>: Unexpected number, e.g. '(1+2)3'.</li>
<li>
<span id="ekUnexpectedWord">ekUnexpectedWord</span>: Unexpected word, e.g. '(1+2)x'.</li>
<li>
<span id="ekUnexpectedParens">ekUnexpectedParens</span>: Unexpected parenthesis, e.g. '1(2+3)'.</li>
<li>
<span id="ekMissingOperand">ekMissingOperand</span>: Missing expected operand, e.g. '0&circ;+1'.</li>
<li>
<span id="ekUnknownOperator">ekUnknownOperator</span>: Unknown operator, e.g. '(1+2).'.</li>
<li>
<span id="ekInvalidFuncName">ekInvalidFuncName</span>: Invalid function name, e.g. 'unknownfunc()'.</li>
<li>
<span id="ekBadParens">ekBadParens</span>: Bad parenthesis, e.g. '(1+2'.</li>
<li>
<span id="ekTooFewFuncArgs">ekTooFewFuncArgs</span>: Too few arguments passed to a macro, e.g. '$()'.</li>
<li>
<span id="ekFirstArgIsNotVar">ekFirstArgIsNotVar</span>: First macro argument is not variable, e.g. '$(1)'.</li>
<li>
<span id="ekBadVariableName">ekBadVariableName</span>: Bad variable name, e.g. '2.3.4'.</li>
<li>
<span id="ekBadAssignment">ekBadAssignment</span>: Bad assignment, e.g. '2=3'.</li>
</ul>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="TBrookMathExpressionErrorEvent"></span><code><strong>TBrookMathExpressionErrorEvent</strong> = procedure(ASender: TObject; AError: <a href="BrookMathExpression.TBrookMathExpressionError.html">TBrookMathExpressionError</a>) of object;</code></td>
</tr>
<tr><td colspan="1">
<p>
Event signature used to handle errors in a mathematical expression.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="TBrookMathExpressionExtensionEvent"></span><code><strong>TBrookMathExpressionExtensionEvent</strong> = function(ASender: TObject; AExtension: <a href="BrookMathExpression.TBrookMathExpressionExtension.html">TBrookMathExpressionExtension</a>): Double of object;</code></td>
</tr>
<tr><td colspan="1">
<p>
Event signature used to handle extension in a mathematical expression.</p>
</td></tr>
</table>
<h3 class="detail">Constants</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><span id="SBrookInactiveMathExpression"></span><code><strong>SBrookInactiveMathExpression</strong> = 'Inactive math expression.';</code></td>
</tr>
<tr><td colspan="1">
<p>
Error message <code>'Inactive math expression.'</code>.</p>
</td></tr>
</table>
<hr><span class="appinfo"><em>Generated by <a href="https://pasdoc.github.io/">PasDoc 0.16.0</a>. </em>
</span>
</div></div></body></html>
